package com.sunyard.dal.bo.org;

import com.sunyard.constant.manage.RegexConst;
import com.sunyard.dal.bo.BaseBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author jiy.fang
 * @ClassName OrganizationAddBO
 * @Description 机构添加BO
 * @date 2019/7/18 14:55
 */
@Data
@ApiModel
public class OrganizationAddBO extends BaseBO {

    private static final long serialVersionUID = 20343954692516725L;

    /**
     * 机构名称
     * 由1-40位中文、字母、数字组合，名称不能重复
     */
    @ApiModelProperty(value = "机构名称", required = true)
    @Size(max = 40)
    @NotBlank(message = "机构名称不能为空")
    @Pattern(regexp = RegexConst.ORG_NAME_GEGEX, message = "机构名称由1-40位中文、字母、数字组合")
    private String orgName;

    /**
     * 机构码
     * 由9位数字组合，不能重复
     */
    @ApiModelProperty(value = "机构码", required = true)
    @NotBlank(message = "机构码不能为空")
    @Pattern(regexp = RegexConst.ORG_ID, message = "机构码只能为1-30个字符")
    private String orgId;

    /**
     * 上级机构
     */
    @ApiModelProperty(value = "上级机构", required = true)
    private String orgPid;

    /**
     * 机构类型 网点/金库/调拨中心/押运公司/类金库
     */
    @ApiModelProperty(value = "1-网点、2-金库、3-调拨中心、4-押运公司、5-类金库", required = true)
    private String orgType;

    /**
     * 围栏范围开关
     */
    @ApiModelProperty(value = "围栏范围开关 0-打开 1-关闭")
    private String orgRailSwitch;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String orgRemark;

    /**
     * 机构级别
     */
    @ApiModelProperty(value = "机构级别")
    private Integer orgLevel;

    /**
     * 工作时间 按周设置(周一到周日对应 1-7 逗号隔开){"date":"1,2,3,4,5","startTime":"13:01:22","endTime":"14:22:22"}
     */
    @ApiModelProperty(value = "工作时间", required = true)
    private OrgWorkingTimeBO orgWorkingTime;

    @ApiModelProperty("注册省份")
    private String proCode;

    @ApiModelProperty("注册城市")
    private String ctCode;

    @ApiModelProperty("注册区县")
    private String disCode;

    @ApiModelProperty("详细地址")
    private String orgAddr;
}
